package org.example.product.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.example.entity.Product;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author fanfutian
 * @since 2025-04-23
 */

@Mapper
public interface ProductMapper {


//    @Results(id = "productResultMap", value = {
//            @Result(property = "id", column = "cid"),
//            @Result(property = "productName", column = "product_name"),
//            @Result(property = "productTitle", column = "product_title"),
//            @Result(property = "productImage", column = "product_image"),
//            @Result(property = "productPrice", column = "product_price"),
//            @Result(property = "productStock", column = "product_stock"),
//            @Result(property = "productDetail", column = "product_detail")
//    })
//    @Select("select * from seckill.product where id = #{productId}")
    Product selectProductById(Long productId);

    List<Product> selectProductAll();

    void updateProduct(Product product);
}
